Optimal. Leaf size=75 \[ -\frac{a \log (a \cos (c+d x)+b)}{d \left (a^2-b^2\right )}+\frac{\log (1-\cos (c+d x))}{2 d (a+b)}+\frac{\log (\cos (c+d x)+1)}{2 d (a-b)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.185584, antiderivative size = 75, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.192, Rules used = {4397, 2668, 706, 31, 633} \[ -\frac{a \log (a \cos (c+d x)+b)}{d \left (a^2-b^2\right )}+\frac{\log (1-\cos (c+d x))}{2 d (a+b)}+\frac{\log (\cos (c+d x)+1)}{2 d (a-b)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4397
Rule 2668
Rule 706
Rule 31
Rule 633
Rubi steps
\begin{align*} \int \frac{\sec (c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx &=\int \frac{\csc (c+d x)}{b+a \cos (c+d x)} \, dx\\ &=-\frac{a \operatorname{Subst}\left (\int \frac{1}{(b+x) \left (a^2-x^2\right )} \, dx,x,a \cos (c+d x)\right )}{d}\\ &=-\frac{a \operatorname{Subst}\left (\int \frac{1}{b+x} \, dx,x,a \cos (c+d x)\right )}{\left (a^2-b^2\right ) d}-\frac{a \operatorname{Subst}\left (\int \frac{-b+x}{a^2-x^2} \, dx,x,a \cos (c+d x)\right )}{\left (a^2-b^2\right ) d}\\ &=-\frac{a \log (b+a \cos (c+d x))}{\left (a^2-b^2\right ) d}-\frac{\operatorname{Subst}\left (\int \frac{1}{-a-x} \, dx,x,a \cos (c+d x)\right )}{2 (a-b) d}-\frac{\operatorname{Subst}\left (\int \frac{1}{a-x} \, dx,x,a \cos (c+d x)\right )}{2 (a+b) d}\\ &=\frac{\log (1-\cos (c+d x))}{2 (a+b) d}+\frac{\log (1+\cos (c+d x))}{2 (a-b) d}-\frac{a \log (b+a \cos (c+d x))}{\left (a^2-b^2\right ) d}\\ \end{align*}
Mathematica [A] time = 0.0624528, size = 64, normalized size = 0.85 \[ \frac{(a-b) \log (1-\cos (c+d x))+(a+b) \log (\cos (c+d x)+1)-2 a \log (a \cos (c+d x)+b)}{2 d (a-b) (a+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.123, size = 75, normalized size = 1. \begin{align*}{\frac{\ln \left ( \cos \left ( dx+c \right ) +1 \right ) }{d \left ( 2\,a-2\,b \right ) }}+{\frac{\ln \left ( -1+\cos \left ( dx+c \right ) \right ) }{d \left ( 2\,a+2\,b \right ) }}-{\frac{a\ln \left ( b+a\cos \left ( dx+c \right ) \right ) }{d \left ( a-b \right ) \left ( a+b \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.06011, size = 99, normalized size = 1.32 \begin{align*} -\frac{\frac{a \log \left (a + b - \frac{{\left (a - b\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{a^{2} - b^{2}} - \frac{\log \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a + b}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.538659, size = 174, normalized size = 2.32 \begin{align*} -\frac{2 \, a \log \left (a \cos \left (d x + c\right ) + b\right ) -{\left (a + b\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) -{\left (a - b\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right )}{2 \,{\left (a^{2} - b^{2}\right )} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec{\left (c + d x \right )}}{a \sin{\left (c + d x \right )} + b \tan{\left (c + d x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.20544, size = 136, normalized size = 1.81 \begin{align*} -\frac{\frac{2 \, a \log \left ({\left | -a - b - \frac{a{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac{b{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} \right |}\right )}{a^{2} - b^{2}} - \frac{\log \left (\frac{{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a + b}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]